package com.media.themovieworld.player;

import io.vov.vitamio.LibsChecker;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;

import com.media.themovieworld.R;

public class MoviePlayerActivity extends Activity{

	private VideoViewController mVideoViewController;
	private int partIndex = 0;
	
	@Override
	public void onCreate(Bundle icicle) {
		super.onCreate(icicle);
		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
		if (!LibsChecker.checkVitamioLibs(this))
			return;
		View v = LayoutInflater.from(this).inflate(R.layout.tmw__video_player_screen, null);
		setContentView(v);
		Intent intent = getIntent();
		if (intent!=null) {
			partIndex = intent.getIntExtra("index", 0);
		}
		mVideoViewController = new VideoViewController(this);
		mVideoViewController.setPartIndex(partIndex);
		mVideoViewController.setRootView(v);
	}
	
	
	@Override
	protected void onPause() {
		super.onPause();
		mVideoViewController.onPause();
	}
	
	@Override
	protected void onResume() {
		super.onResume();
		mVideoViewController.onResume();
	}
}
